<!DOCTYPE html >
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>流程管理</title>

    <!-- Bootstrap -->
    <link th:href="@{/bootstrap/css/bootstrap.css}" rel="stylesheet">
    <link th:href="@{/css/content.css}" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
</head>
<body>
<script type="text/javascript" th:inline="javascript">
    /*$(function () {
        $("#delHref").click(function () {
            if (confirm("你是否要删除该请假记录")){
                $("#delHref").attr("href","#");
            }
            $("#delHref").attr("href","#");
        })
    })*/

    function delConfirm(id) {

        var basePath = [[@{/leavebill/leaveBillAction_delete}]] + "/" + id;

        alert(basePath);

        if (confirm("你是否要删除该请假记录")) {
            $("#delHref").attr("href",basePath);
        } else {
            $("#delHref").attr("href", "#");
        }
    }
</script>
<!--路径导航-->
<ol class="breadcrumb breadcrumb_nav">
    <li>首页</li>
    <li>请假管理</li>
    <li class="active">我的请假单</li>
</ol>
<!--路径导航-->

<div class="page-content">
    <form class="form-inline">
        <div class="panel panel-default">
            <div class="panel-heading">请假单列表</div>

            <div class="table-responsive">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>标题</th>
                        <th>天数</th>
                        <th>开始时间</th>
                        <!-- <th>结束时间</th>-->
                        <th>备注</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="lb:${leavebills}">
                        <td th:text="${lb.id}">${bill.id}</td>
                        <td th:text="${lb.content}">${bill.money}</td>
                        <td th:text="${lb.days}">${bill.title}</td>
                        <td th:text="${#dates.format(lb.leaveDate,'yyyy-MM-dd HH:mm:ss')}">${bill.remark}</td>
                        <!-- <td th:text="${#dates.format(lb.leaveDate+3,'yyyy-MM-dd HH:mm:ss')}">${bill.remark}</td>-->
                        <td th:text="${lb.remark}"></td>
                        <td th:if="${lb.state == 1}">
                            审批中
                        </td>
                        <td th:if="${lb.state == 2}">
                            审批完成
                        </td>
                        <td th:if="${lb.state == 1}">
                            <a th:href="@{|/leavebill/viewHisComment/${lb.id}|}"
                               class="btn btn-success btn-xs"><span class="glyphicon glyphicon-eye-open"></span>
                                查看审核记录</a>
                            <a th:href="@{|/leavebill/viewCurrentImageByBill/${lb.id}|}"
                               target="_blank"
                               class="btn btn-success btn-xs"><span class="glyphicon glyphicon-eye-open"></span>
                                查看当前流程图</a>
                        </td>
                        <td th:if="${lb.state == 2}">
                            <a th:href="@{|/leavebill/leaveBillAction_delete/${lb.id}|}"
                               th:onclick="|delConfirm(${lb.id})|" id="delHref" class="btn btn-danger btn-xs"><span
                                    class="glyphicon glyphicon-remove"></span> 删除</a>
                            <a th:href="@{|/leavebill/viewHisComment/${lb.id}|}"
                               class="btn btn-success btn-xs"><span class="glyphicon glyphicon-eye-open"></span>
                                查看审核记录</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </form>

</div>
</body>
</html>